(C) 1996 AROS - The Amiga Replacement OS


NAME
#include <graphics/gfx.h>
#include <proto/graphics.h>
struct BitMap * AllocBitMap()
SYNOPSIS
ULONG sizex
ULONG sizey
ULONG depth
ULONG flags
struct BitMap * friend_bitmap

LOCATION
In GfxBase at offset 153
FUNCTION
Allocates and initializes a bitmap structure. Allocates and initializes bitplane data, and sets the bitmap's planes to point to it.

INPUTS
sizex, sizey
The width and height in pixels
depth
The depth of the bitmap. A depth of 1 will allocate a bitmap for two colors, a depth of 24 will allocate a bitmap for 16 million colors. Pixels with AT LEAST this many bits will be allocated.
flags
One of these flags: \begin{description} \item{BMF_CLEAR} Fill the bitmap with color 0. \item{BMF_DISPLAYABLE} to specify that this bitmap data should be allocated in such a manner that it can be displayed. Displayable data has more severe alignment restrictions
non
displayable data in some systems. \item{BMF_INTERLEAVED} tells graphics that you would like your bitmap to be allocated with one large chunk of display memory for all bitplanes. This minimizes color flashing on deep displays. If there is not enough contiguous RAM for an interleaved bitmap, graphics.library will fall back to a
non
interleaved one. \item{BMF_MINPLANES} causes graphics to only allocate enough space in the bitmap structure for "depth" plane pointers. This is for system use and should not be used by applications use as it is inefficient, and may waste memory. \end{description}
friend_bitmap
pointer to another bitmap, or NULL. If this pointer is passed, then the bitmap data will be allocated in the most efficient form for blitting to friend_bitmap.
RESULT
A pointer to the new bitmap.

NOTES
When allocating using a friend bitmap, it is not safe to assume anything about the structure of the bitmap data if that friend BitMap might not be a standard amiga bitmap (for instance, if the workbench is running on a non-amiga display device, its Screen->RastPort->BitMap won't be in standard amiga format. The only safe operations to perform on a non-standard BitMap are:

Good arguments to pass for the friend_bitmap are your window's RPort->BitMap, and your screen's RastPort->BitMap. Do NOT pass &(screenptr->BitMap)!

BitMaps not allocated with BMF_DISPLAYABLE may not be used as Intuition Custom BitMaps or as RasInfo->BitMaps. They may be blitted to a BMF_DISPLAYABLE BitMap, using one of the BltBitMap() family of functions.

EXAMPLE
BUGS
SEE ALSO
FreeBitMap()
INTERNALS
HISTORY
13.03.1997 digulla
Several new functions